//
//  KDNotyCell.m
//  WangJingApp
//
//  Created by 魏强 on 17/1/23.
//  Copyright © 2017年 KDTech. All rights reserved.
//

#import "KDNotyCell.h"
@interface KDNotyCell ()
@property (weak, nonatomic) IBOutlet UILabel *titleLb;
@property (weak, nonatomic) IBOutlet UILabel *timeLb;
@property (weak, nonatomic) IBOutlet UIButton *signBtn;


@end
@implementation KDNotyCell
#pragma mark - 懒加载区
- (void)setModel:(KDNotyCellModel *)model{
    _model = model;
    self.timeLb.text = model.create_date;
    self.titleLb.text = model.cntnt_title;
    self.signBtn.enabled = !model.isSigned;
    
}
#pragma mark - 生命周期区
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    NSString *cellId =@"KDNotyCell";
    KDNotyCell *cell =[tableView dequeueReusableCellWithIdentifier:cellId];
    if (cell == nil)
    {
        cell =[[[NSBundle mainBundle]loadNibNamed:@"KDNotyCell" owner:self options:nil]lastObject];
    }
//    cell.contentView.backgroundColor = BackGroundColor;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
#pragma mark - 板块布置区

#pragma mark - 事件点击区
/**
 *  签收按钮被电击了
 */
- (IBAction)signBtnClick:(UIButton *)sender {
    
    if (_delegate && [_delegate respondsToSelector:@selector(KDNotyCell:signBtnClick:)]) {
        self.model.isSigned = YES;
        self.signBtn.enabled = NO;
//        self.signBtn
        [_delegate KDNotyCell:self signBtnClick:sender];
    }
}


#pragma mark - 网络请求区

#pragma mark - 通知接收区
- (void)awakeFromNib {
    // Initialization code
}



@end
